/********************************************************************************
 * Copyright (c)2016-2020, ShenZhen WanJiaAn Technology CO.,LTD.
 * All Rights Reserved.
 *
 * File Name     : DevKey.h
 * Author        : joki.zhu
 * Date          : 2019-10-18
 *
 * Record        :
 * 1.Date        : 2019-10-18
 *   Author      : joki.zhu
 *   Modification: Created file
 ********************************************************************************/

#ifndef __DEVKEY_H__
#define __DEVKEY_H__


#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */

typedef int (*KEY_PROC_CALLBACK_FN_PTR)(void);

typedef enum {
    KEY_TYPE_NONE = -1,
    KEY_TYPE_BELL,      /* 门铃按键 */
    KEY_TYPE_PICK,      /* 防撬按键 */
    KEY_TYPE_CONFIG,    /* 配置按键 */
    KEY_TYPE_NUM,
}KEY_TYPE_E;

typedef enum {
    KEY_STATE_NONE = -1,
    KEY_STATE_PRESSED,
    KEY_STATE_RELEASED,
    KEY_STATE_LONGRESS,
    KEY_STATE_NUM,
}KEY_STATE_E;

int KeyInit(void);
int KeyEventRegister(KEY_TYPE_E enKeyType, KEY_STATE_E enKeyState, KEY_PROC_CALLBACK_FN_PTR pfnKeyProc);
int KeyEventUnRegister(KEY_TYPE_E enKeyType, KEY_STATE_E enKeyState, KEY_PROC_CALLBACK_FN_PTR pfnKeyProc);
int KeyDeinit(void);


#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */


#endif /* __DEVKEY_H__ */
